package com.cxhc.system.service.app.impl;

import com.cxhc.system.mapper.app.CmHandlingInfoMapper;
import com.cxhc.system.mapper.app.CmHouseholdInfoMapper;
import com.cxhc.system.mapper.app.CmRoomInfoMapper;
import com.cxhc.system.mapper.cockpit.RpFeedbackMapper;
import com.cxhc.system.service.app.ICmRedoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class ICmRedoServiceImpl implements ICmRedoService {

    @Autowired
    private CmRoomInfoMapper cmRoomInfoMapper;
    @Autowired
    private CmHouseholdInfoMapper cmHouseholdInfoMapper;
    @Autowired
    private CmHandlingInfoMapper cmHandlingInfoMapper;
    @Autowired
    private RpFeedbackMapper rpFeedbackMapper;
    @Override
    public List<Map<String,String>> selectRedooList(String userId) {
        List<Map<String,String>> resMapList = new ArrayList<>();
        //获取房间待办信息
        List<Map<String,String>> roomMapList = cmRoomInfoMapper.selectRoomByCheckNameId(userId);
        //获取人员待办信息
        List<Map<String,String>> householdMapList = cmHouseholdInfoMapper.selectHouseholdByCheckNameId(userId);
        //获取举报待办信息
        List<Map<String,String>> handlingMapList = cmHandlingInfoMapper.selectHandlingByCheckNameId(userId);
//        //获取联勤事件待办信息
//        List<Map<String,String>> feedbackMapList = rpFeedbackMapper.selectFeedBackByCompleteUserID(userId);
        if (!CollectionUtils.isEmpty(roomMapList)){
            resMapList.addAll(roomMapList);

        }
        if (!CollectionUtils.isEmpty(householdMapList)){
            resMapList.addAll(householdMapList);

        }
        if (!CollectionUtils.isEmpty(handlingMapList)){
            resMapList.addAll(handlingMapList);

        }
//        if (!CollectionUtils.isEmpty(feedbackMapList)){
//            resMapList.addAll(feedbackMapList);
//        }
        return resMapList;
    }
}
